package com.example.springboot.controller.admin;


import com.example.springboot.model.entity.MallRegion;
import com.example.springboot.model.enums.ResultCodeEnum;
import com.example.springboot.model.form.Result;
import com.example.springboot.service.admin.MallRegionService;
import com.example.springboot.utils.Assert;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zf
 * @version 1.0
 * @ClassName MallRegionController
 * @地址对应关系表
 * @since 2021-02-28
 */
@RestController
@RequestMapping("/mall-region")
public class MallRegionController {

    @Resource
    private MallRegionService service;

    /**
     * @param req
     * @Description: 列表
     */
    @PostMapping("/list")
    public Result list(MallRegion req) {
        return service.getPage(req);
    }

    /**
     * @param ids
     * @Description: 批量删除
     */
    @PostMapping("/deleteIds")
    public Result deleteInfos(String ids) {
        Assert.isNull(ids, ResultCodeEnum.CLIENT_PARAM_ERROR);
        return service.deleteInfos(ids);
    }
}

